package com.yeyks.vip.dal.domain;

import com.baomidou.mybatisplus.annotation.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * vip卡支付订单表
 * </p>
 *
 * @author yun
 * @since 2019-10-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "MemberCardEnableOrder对象", description = "vip卡支付订单表")
public class MemberCardEnableOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "订单号")
    @TableField("order_no")
    private String orderNo;

    @ApiModelProperty(value = "1:甄选  2：精选")
    @TableField("card_type")
    private Integer cardType;

    @ApiModelProperty(value = "卡号")
    @TableField("card_no")
    private String cardNo;

    @ApiModelProperty(value = "状态，1待支付,2支付成功,3支付失败")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "支付方式，0微信，1支付宝，4小程序，5公众号，6wallet")
    @TableField("payment_method")
    private Integer paymentMethod;

    @ApiModelProperty(value = "支付金额(分)")
    @TableField("pay_value")
    private Integer payValue;

    @ApiModelProperty(value = "订单完成时间")
    @TableField("over_time")
    private Date overTime;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "标志，1推手订单")
    @TableField("sign")
    private Integer sign;


    public static final String ID = "id";

    public static final String ORDER_NO = "order_no";

    public static final String CARD_TYPE = "card_type";

    public static final String CARD_NO = "card_no";

    public static final String STATUS = "status";

    public static final String PAYMENT_METHOD = "payment_method";

    public static final String PAY_VALUE = "pay_value";

    public static final String OVER_TIME = "over_time";

    public static final String CREATE_TIME = "create_time";

    public static final String SIGN = "sign";

    public enum Status {
        wait(1, "待支付"),
        success(2, "支付成功"),
        fail(3, "支付失败");
        int value;
        String desc;

        Status(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public Integer value() {
            return this.value;
        }

        public String desc() {
            return this.desc;
        }

        public static String getDesc(int value) {
            for (Status status : values()) {
                if (status.value() == value) {
                    return status.desc();
                }
            }
            return null;
        }
    }
}
